version 7.0log using JVconthresh_ci.log, replace#delimit ;*     ***************************************************************** *;*     ***************************************************************** *;*   File-Name:  JVconthresh_ci.do                                       *;*   Date:       June 12, 2001                                           *;*   Author:     MRG                                                     *;*   Purpose:    Take Jackman and Volpert's 1996 BJPS piece and          *;*               calculate conditonal coefficients and standard errors   *;*               for threshold.                                          *;*   Input File: JV.dta                                                  *;*   Output File:JVconthresh_ci.log                                      *;*   Data Output:JVconthresh_ci.dta                                      *;*   Previous file:                                                      *;*   Machine:    system7                                                 *;*     ****************************************************************  *;*     ****************************************************************  *;use h:\JackmanReplication\replication\JV.dta;summarize; rename countr country;rename elyear year;label var year "election year";label var erps "extreme right percentage support";rename unem unemp;label var unemp "unemployment rate";rename state1 austria;rename state2 belgium;rename state3 denmark;rename state4 finland;rename state5 france;rename state6 germany;rename state7 greece; rename state8 ireland;rename state9 italy;rename state10 netherlands;rename state11 norway;rename state12 portugal;rename state13 spain;rename state14 sweden;rename state15 switzerland;rename state16 unitedkingdom;rename enpp enp;label var enp "effective number of parties";label var lerps "natural log of erps + 1";label var thresh "effective threshold";rename thresxpp threshenp;label var threshenp "effective threshold x enp";*     ****************************************************************  *;*       Summary statistics.  Compare to Table 1, page 511               *;*     ****************************************************************  *;summarize erps lerps thresh enp unemp;*     ****************************************************************  *;*       Replicate Model 2: page 514.  Tobit with interaction terms.     *;*     ****************************************************************  *;tobit lerps thresh threshenp enp unemp austria belgium denmark finland france    germany greece ireland italy netherlands norway portugal spain     sweden switzerland, ll(0) ltolerance (1e-5);*     ****************************************************************  *;*       Calculate conditional coefficients and standard errors for      *;*       threshold.                                                      *;*     ****************************************************************  *;set more off;*     ****************************************************************  *;*       Specify model such as y x j xj                                  *;*     ****************************************************************  *;tobit  lerps thresh enp threshenp unemp austria belgium denmark finland     france germany greece ireland italy netherlands norway portugal     spain sweden switzerland, ll(0) ltolerance (1e-5);*     ****************************************************************  *;*       enp i.e. x2 = JH                                                *;*     ****************************************************************  *;generate JH=((_n-1)/10);    replace JH=. if _n>60;generate str1 txt="*";matrix b=e(b);matrix V=e(V);scalar b1=b[1,1];scalar b2=b[1,2];scalar b3=b[1,3];scalar varb1=V[1,1];scalar varb3=V[3,3];scalar covb1b3=V[1,3];set more off;scalar list b1 b2 b3 varb1 varb3 covb1b3;*     ****************************************************************  *;*       except for in left hand side of following, do search and replace*;*       for JH below                                                    *;*     ****************************************************************  *;gen conb=b1+b3*JH if _n<60;set more off;list conb in 1/20;*     ****************************************************************  *;*      These create conditional coefficients for b1 at JH, x3H#         *;*     ****************************************************************  *;*      We can write the following code as a template, then sub in the   *;*      names of the "variables" for JH *x3 .   "variables" because they *;*      won't be the real variables.  Instead, they'll be the variables  *;*      created to represent the relevant values of the modifying        *;*      variables.                                                       *;*     ****************************************************************  *;gen conse=sqrt(varb1+varb3*JH^2+2*covb1b3*JH)  if _n<60;set more off;list conse in 1/20;gen cont= conb/conse; list cont in 1/20; *     ****************************************************************  *;*      This creates a conditional t for each level of JHHH given which  *;*      x3H is chosen                                                    *;*     ****************************************************************  *;gen conbS = conb;*     ****************************************************************  *;*       These create "shadow" (thus the "S") variables for each of the  *;*       conditional b's.  Statistical significance indicated at 95%     *;*       level.                                                          *;*     ****************************************************************  *; replace conbS = . if abs(cont)<1.98;list conbS in 1/20;*     ****************************************************************  *;*      This creates missing values for all the insignificant shadow b's.*;*     ****************************************************************  *;*     ****************************************************************  *;*     ****************************************************************  *;*       Generate confidence intervals at the 95% level                  *;*     ****************************************************************  *;*     ****************************************************************  *;gen a=1.98*conse;gen top=conb+a;gen bottom=conb-a;*     ****************************************************************  *;*      This creates missing values for all the insignificant shadow b's.*;*     ****************************************************************  *;set textsize 100;label var JH "Effective Number of Parties";label var conb "Coefficient for THRESH";label var conbS "* indicates p<0.05";*     ****************************************************************  *;*       Graph the effect of threshold on ERPS conditional on effective  *;*       number of parties                                               *;*     ****************************************************************  *;gprefs set window scheme blackbg;gprefs set window update;gprefs set custom1 pen2_thick 9;graph   conb top bottom JH, psize(150) noaxis ylab(-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4) xlab(0 1 2 3 4 5 6)  yline(0) pen(955)  symbol(...)  c(l l[_.]l[_.]) sort ; set textsize 100;                 *     ****************************************************************  *;*       Note that there is a region where threshold is not significant  *;*       (2.3 to 3.1 ENP). 35 observations fall within                   *;*       this region.                                                    *;*     ****************************************************************  *;save    JVconthresh_ci, replace;exit;